<?php
include 'common.php';

$db = new DB($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);

switch($_SERVER['REQUEST_METHOD']){
    case 'POST':
        echo 'post...';
        break;
    case 'GET':
        $sql = 'select * from `contacts`';
        $ret = $db->get_results($sql);
        echo json_encode($ret);
        break;
    case 'PUT':
        echo 'put...';
        break;
    case 'DELETE':
        echo 'delete...';
        break;
}
